﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Text.RegularExpressions;


namespace ENLibraryClass
{
    public class Validacion
    {
        //EXPRESIONES REGULARES

        static public string patronNumero = @"^\d{1,100}$";

        static public string patronDni = @"^\d{8}\S{1}$";

        static public string patronTelf = @"^\d{9}$";

        static public string patronEmail = @"^\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*";

        static public string patronWeb = @"([\w-]+\.)+[\w-]+(/[\w- ./?%&=]*)?";

        static public string patronCP = @"^\d{5}$";





        static public bool Valida(string cadena, string patronExpr)
        {
            return Regex.Match(cadena, patronExpr).Success;
        }
    }
}
